Plugin SDK |
If you have any questions or problems developing plugins for Samurize, be sure to stop by the samurize.com forums for help from
other community members and the development team. NOTES: The SAMURIZE_PLUGIN_CHAR and SAMURIZE_PLUGIN_INT types are defined as #define SAMURIZE_PLUGIN_CHAR extern "C" __declspec(dllexport) char* __stdcall
In Delphi they are simply the PChar and Integer types. Function List |
BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) |
The standard DLLMain function. You can use this function to do one-off initialization and
de-initialization for your plugin using the DLL_PROCESS_ATTACH and DLL_PROCESS_DETACH reasons for call. See here for more information. Parameters:
This function should return TRUE. |
SAMURIZE_PLUGIN_CHAR init() |
The init() function tells Samurize the names of the functions your source plugin provides.
It should return a list like so: "Func1|Func2|...|FuncN" Return Value: A list of all the functions your source plugin provides eg. "My Function 1|Some other function|And another" |
SAMURIZE_PLUGIN_INT dlltype() |
Tells Samurize what type of plugin this is.
If this function is declared, Samurize will assume you are using the SDK v2.0;
The value you should return is a summation of any or all of the following values: 1: Source plugin 2: Visual plugin 4: Input plugin ... (more to follow!) eg. returning 2 tells Samurize your plugin is a visual plugin. Returning 3 tells Samurize your plugin is a visual plugins AND has a source plugin component as well. |
SAMURIZE_PLUGIN_CHAR getinfo(int infonum) |
This function should return information about your plugin depending on the passed integer value.
This information is displayed when the 'About' button is pressed in the config editor when your plugin
is selected. This function is optional. Parameters:
|
SAMURIZE_PLUGIN_INT dllstartup(HWND hwnd, int dlltype) |
dllstartup() is called every time Samurize creates a meter that uses this plugin. Any memory allocation needed on a meter-by-meter basis should be done in this function. Parameters:
This function should return a unique integer ID that Samurize remembers and uses for other functions (this is so multiple instances of Samurize that use this plugin do not conflict). If your plugin is very simple and does not need to keep any global variables that may cause conflicts, just return 0 (or omit this function). |
SAMURIZE_PLUGIN_INT dllshutdown(int id) |
dllshutdown() is called every time a meter using the plugin is destroyed by Samurize. Any memory releasing needed on a meter-by-meter basis should be done in this function. If your plugin does not need to free any memory, this function may be omitted. Parameters:
This function should always return 0. |
SAMURIZE_PLUGIN_CHAR save_xml(int id) |
save_xml() is called when the config is being saved to an XML file by the Samurize server
executable.
Your plugin should return its settings in XML format as follows:<SETTING ATTR="attribute1">attribute value</SETTING> <SETTING ATTR="myattribute">123</SETTING> <SETTING ATTR="anotherattribute">some value</SETTING>Parameters:
|
SAMURIZE_PLUGIN_INT pastemeter(int source_id, int dest_id) |
pastemeter is called when a meter is pasted in the config editor.
Your plugin should clone the settings from the source meter (indicated by source_id)
to the cloned meter (indicated by dest_id). Parameters:
This function should return 0. |